package com.qijian.maindata.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qijian.maindata.domain.InspectionScheme;
import com.qijian.maindata.domain.query.InspectionSchemeQuery;
import com.qijian.maindata.domain.vo.InspectionBomVo;
import com.qijian.maindata.domain.vo.InspectionSchemeVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Set;

/**
 * 检验方案-新Mapper接口
 *
 * @author qijian
 * @date 2024-02-02
 */
public interface InspectionSchemeMapper extends BaseMapper<InspectionScheme> {

    @Select("select count(0) from main_inspection_scheme")
    int countWithDel();

    InspectionSchemeVo getInfo(@Param("id") Long id);


    List<InspectionBomVo> selectBomVo(@Param("ids")Set<Long> bomIds);

    //未绑定默认检验方案的所有bom
    List<InspectionBomVo> selectUnbindBomVo(@Param("defaultCnt") Integer defaultCnt);
    //手动刷新时使用
    List<InspectionBomVo> selectUnbindBomVoForDefault(Long bomId);

    Page<InspectionSchemeVo> pageForOutInspection(Page<InspectionScheme> page, @Param(Constants.WRAPPER)QueryWrapper<InspectionSchemeQuery> queryWrapper);
}
